package com.relatev.minecraft.TRMobSpawn;

import com.relatev.minecraft.TRMobSpawn.listener.SpawnListener;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.java.JavaPlugin;

public class TRMobSpawn extends JavaPlugin {

    public static TRMobSpawn MainPlugin;

    @Override
    public void onEnable() {
        MainPlugin = this;
        ConfigManager.init();
        DataManager.init();
        SpawnListener.init();
        SpawnPointTask.init();
        this.getLogger().info("作者缇亚祢|群号664015345");
    }
    
    @Override
    public void onDisable(){
        DataManager.save();
        HandlerList.unregisterAll(this);
        Bukkit.getScheduler().cancelTasks(MainPlugin);
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
        return CommandManager.onCommand(sender, command, label, args);
    }
}
